@include("user.head")
	<!-- 公共头部 -->

	<div id="content_person">
	<div class="row">
		<div class="col-xs-3">
		@include('user.uc.navigation')
		</div>
		<div class="col-xs-9">
			<div class="person_right" style="min-height:550px;">
				<div class="yndw_info">
					<div class="form-horizontal">
					  <fieldset>
					    <legend>近年开展项目表</legend>
					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">项目名称</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="name" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">项目委托单位</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="master" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">项目开始时间</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size date-time-picker" readonly name="start_time" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">项目结束时间</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size date-time-picker" readonly name="end_time" placeholder="" type="text">
					      </div>
					    </div>
					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">工作内容</label>
					      <div class="col-xs-10">
					        <textarea class="form-control input_size" name="content" placeholder="" type="text"></textarea>
					      </div>
					    </div>
					    <div class="form-group">
					      <div class="col-xs-10 col-xs-offset-2">
					        <button type="button" id="sub" class="btn btn-primary ">保存修改</button>
					      </div>
					    </div>
					  </fieldset>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>

	<!-- 公共底部 -->
	@include("user.footer")
	<!-- 公共底部 -->
	@include("user.common")
</body>
<script type="text/javascript">
var hid;
var url = "edit_projects/add";
if("<%Input::has('hid')%>")
{
	hid = "<%Input::get('hid')%>";
	$.get("edit_projects/get", {hid : hid}, function (data){
		if(data.success)
		{
			$("input[name='name']").val(data.name);
			$("input[name='master']").val(data.master);
			$("input[name='start_time']").val(data.start_time);
			$("input[name='end_time']").val(data.end_time);
			$("textarea[name='content']").val(data.content);
			url = "edit_projects/update";
		}
	})
}
$("#sub").bind("click", function(){
	var name 		= $("input[name='name']").val().trim();
	var master 		= $("input[name='master']").val().trim();
	var start_time 	= $("input[name='start_time']").val().trim();
	var end_time 	= $("input[name='end_time']").val().trim();
	var content 	= $("textarea[name='content']").val().trim();

	if(name == '' || master == '' || start_time == '' || end_time == '' || content == '' )
	{
		warning("", "必填内容不能为空");
		return;
	}

	$.post(url, {
		name : name,
		master : master,
		start_time : start_time,
		end_time : end_time,
		content : content,
		hid : hid
	}, function (data){
		if(data.success)
		{
			success("", "提交成功");
			setTimeout(function(){
				window.location.reload();
			},1000)
		}
	})
})


</script>
</html>